import { Application } from '@splinetool/runtime'
import { ref } from 'vue'

export const userInit3D = () => {
  // 加载进度条
  const loadinginfo = ref(false)
  //创建3D图表
  const ref3d = ref(null)
  const init3dModel = () => {
    loadinginfo.value = true
    const spline = new Application(ref3d.value)
    spline.load('https://fe-hmzs.itheima.net/scene.splinecode').then(() => {
      loadinginfo.value = false
      console.log('3d图形获取到了')
    })
  }
  return { loadinginfo, ref3d, init3dModel }
}
